
var  beforepagetime="1"; 
var  nextpagetime="1"; 

function loadXMLDoc()
{ 
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  } 
xmlhttp.onreadystatechange=function()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	  {
		var ActivityInfor=new Array;
	    var title=new Array(3);
	    var time=new Array(3);
	    var place=new Array(3);
	    var money=new Array(3);
	    var type=new Array(3);
	    var activities=new Array(3);
	    var publishtime=new Array(3);
	    var username=new Array(3);
	    ActivityInfor=xmlhttp.responseText.split("#");
	    
		  for(var i=0;i<3;i++)					
		  { title[i]=ActivityInfor[i];		  					
		    time[i]=ActivityInfor[i+3];
		    place[i]=ActivityInfor[i+6];
		    money[i]=ActivityInfor[i+9];
		    type[i]=ActivityInfor[i+12];
		    activities[i]=ActivityInfor[i+15];
		    publishtime[i]=ActivityInfor[i+18];
		    username[i]=ActivityInfor[i+21];
		   }		  
	 
	   for(var i=0;i<3;i++)	
		   {
		   document.getElementById("atitle"+(i+1)).innerHTML=title[i]+"-"+username[i]+publishtime[i];  
		   document.getElementById("atime"+(i+1)).innerHTML= "活动时间："+time[i];
		   document.getElementById("aplace"+(i+1)).innerHTML="活动地点："+place[i];
		   document.getElementById("amoney"+(i+1)).innerHTML="活动费用："+money[i];
		   document.getElementById("atype"+(i+1)).innerHTML="活动类型："+type[i];
		   document.getElementById("activity"+(i+1)+"_2").innerHTML=activities[i];
		   }
	   	
	   beforepagetime=publishtime[2];
	   nextpagetime=publishtime[0];
	}
}
xmlhttp.open("POST","IndexServlet",true);//URL中servlet文件不要有拓展名。
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(null);	
//setTimeout("loadXMLDoc()",100);
}

function BeforePage()
{	

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  } 

xmlhttp.onreadystatechange=function()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	  {
		var ActivityInfor=new Array;
	    var title=new Array(3);
	    var time=new Array(3);
	    var place=new Array(3);
	    var money=new Array(3);
	    var type=new Array(3);
	    var activities=new Array(3);
	    var publishtime=new Array(3);
	    var username=new Array(3);
	    ActivityInfor=xmlhttp.responseText.split("#");

		  for(var i=0;i<3;i++)					
		  { title[i]=ActivityInfor[i];		  					
		    time[i]=ActivityInfor[i+3];
		    place[i]=ActivityInfor[i+6];
		    money[i]=ActivityInfor[i+9];
		    type[i]=ActivityInfor[i+12];
		    activities[i]=ActivityInfor[i+15];
		    publishtime[i]=ActivityInfor[i+18];
		    username[i]=ActivityInfor[i+21];
		   }		  

	   for(var i=0;i<3;i++)	
		   {
		   document.getElementById("atitle"+(i+1)).innerHTML=title[i]+"-"+username[i];  
		   document.getElementById("atime"+(i+1)).innerHTML= "活动时间："+time[i];
		   document.getElementById("aplace"+(i+1)).innerHTML="活动地点："+place[i];
		   document.getElementById("amoney"+(i+1)).innerHTML="活动费用："+money[i];
		   document.getElementById("atype"+(i+1)).innerHTML="活动类型："+type[i];
		   document.getElementById("activity"+(i+1)+"_2").innerHTML=activities[i];
		   }
	 /*  alert("22222222222222222");  */ 	  
	  }
}
   /*alert("111111111111111");*/
     var pageTime;    
	xmlhttp.open("POST","IndexPageServlet?pageTime="+beforepagetime,true);//URL中servlet文件不要有拓展名。
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send(null);	
	
}
function NextPage()
{	

var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  } 

xmlhttp.onreadystatechange=function()
{
	if (xmlhttp.readyState==4 && xmlhttp.status==200)
	  {
		var ActivityInfor=new Array;
	    var title=new Array(3);
	    var time=new Array(3);
	    var place=new Array(3);
	    var money=new Array(3);
	    var type=new Array(3);
	    var activities=new Array(3);
	    var publishtime=new Array(3);
	    var username=new Array(3);
	    ActivityInfor=xmlhttp.responseText.split("#");

		  for(var i=0;i<3;i++)					
		  { title[i]=ActivityInfor[i];		  					
		    time[i]=ActivityInfor[i+3];
		    place[i]=ActivityInfor[i+6];
		    money[i]=ActivityInfor[i+9];
		    type[i]=ActivityInfor[i+12];
		    activities[i]=ActivityInfor[i+15];
		    publishtime[i]=ActivityInfor[i+18];
		    username[i]=ActivityInfor[i+21];
		   }		  

	   for(var i=0;i<3;i++)	
		   {
		   document.getElementById("atitle"+(i+1)).innerHTML=title[i]+"-"+username[i];  
		   document.getElementById("atime"+(i+1)).innerHTML= "活动时间："+time[i];
		   document.getElementById("aplace"+(i+1)).innerHTML="活动地点："+place[i];
		   document.getElementById("amoney"+(i+1)).innerHTML="活动费用："+money[i];
		   document.getElementById("atype"+(i+1)).innerHTML="活动类型："+type[i];
		   document.getElementById("activity"+(i+1)+"_2").innerHTML=activities[i];
		   }   	  
	  }
}

    var pageTime;    
	xmlhttp.open("POST","IndexPageServlet?pageTime="+nextpagetime,true);//URL中servlet文件不要有拓展名。
	xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xmlhttp.send(null);	
	
}